<%@ page language="java" import="java.util.*,com.nail.zhaogr.model.*" pageEncoding="utf-8"%>
  
  <%
  Members members=new Members();
  String loginName ="";
  if(session.getAttribute("memberInfo")!=null){
  	members = (Members)session.getAttribute("memberInfo");
  	loginName = members.getLoginName();
  }
  
  %>
	<div class="topBar">
		<div class="twidth">
			<div id="currentCity">
				<font>成都</font><a href="#">切换城市</a>
				<label id="welcomeMsg" style="padding-left:10px">
				</label>
			</div>
			<div id="topUser">
				<a href="${ctx}/PublishInfo/create.do" class="postMsg">免费发布信息</a>
				<a id="memberLink" href="${ctx}/MemberCenter/index.do">会员中心</a>
				<a id="exitLink" href="${ctx}/Login/exit.do">退出</a>
				<a id="loginLink" href="${ctx}/Login/indexLogin.do">我要登录</a>
				<a id="registerLink" href="${ctx}/Register/indexMembers.do">我要注册</a>
				<a href="javascript:void(0);" onClick="window.external.AddFavorite(document.location.href,document.title)">加入收藏</a>
				<a href="javascript:void(0);" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.zhaogr.com');">设为首页</a>
			</div>
		</div>
	</div>
	
	<div class="twidth">
	<div id="logo"><img src="${ctx}/images/logo.jpg" /></div>
	
	<div id="sitehead">
	<div class="l"></div>
	<div class="r"></div>
	<div class="m">
		<!-- 
	     <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr align="center">
	        <td width="160"><a href="http://www.wangqi.com"><img src="pic/logo.gif" border="0" alt="" width="185" height="53" /></a></td>
	        <td align="right"><a href="http://ip.wangqi.com" target="_blank"><img src="upload/1.jpg" alt="" width="759" height="73" /></a></td>
		</tr>
	     </table>-->
	</div>
	</div>
	
	<div id="navbar">
	<div class="l"></div>
	<div class="r"></div>
	<div class="m">
		<a href="${ctx}/" id="indexPage">首页</a>
		<a href="${ctx}/Index/index.do" id="psnPage">找工人</a>
		<a href="#">工厂招工</a><a href="#">热门职位</a><a 
	href="#" title="6">我的社区</a>
		
	<div id="search" >
				<input type="text"  id="searchValue" name="searchValue" value="${profile}" class="inputbg" size="20" value=""/>
				　<button type="button" onclick="doSearch()">搜索</button>
	</div>
	</div>
	
	</div>
  </div>
  
  <script>
  	
  	if('<%=loginName%>'!=''){
  		document.getElementById("welcomeMsg").innerText='欢迎您：<%=loginName%>';
  		document.getElementById("memberLink").style.display='';
  		document.getElementById("exitLink").style.display='';
  		document.getElementById("loginLink").style.display='none';
  		document.getElementById("registerLink").style.display='none';
  	}else{
  		document.getElementById("memberLink").style.display='none';
  		document.getElementById("exitLink").style.display='none';
  		document.getElementById("loginLink").style.display='';
  		document.getElementById("registerLink").style.display='';
		document.getElementById("welcomeMsg").innerText='亲爱的游客，您好！';
  	}
  	
  	function doSearch(){
  		var searchKey = document.getElementById("searchValue").value;
  		window.location.href="${ctx}/PublishInfo/list.do?profile="+searchKey+"&cityTwo="+searchKey+"&cityThree="+searchKey+"&cityOne="+searchKey;
  	}
  	
  	
  </script>
